export const VIP_ROUTES = filterRoles('VIP')
export const SVIP_ROUTES = filterRoles('SVIP')

/**
 * 筛选路由
 * @param {Object} role
 */
function filterRoles(role) {
	return ROUTES.filter(it => {
		let roles = it.meta && it.meta.roles
		if (roles) {
			if (typeof roles === 'string') {
				return roles === role
			} else if (roles instanceof Array) {
				return roles.indexOf(role) !== -1
			}
		}
	}).map(it => it.path.substr(1))
}
